package com.qqtech.qquan.community.model;

import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.qqtech.core.common.util.StringUtil;
import com.qqtech.core.common.util.TimeUtil;
import com.qqtech.qquan.user.enums.UserConst;
import com.qqtech.qquan.user.model.UserBase;

@SuppressWarnings("serial")
public class CommunityMessageVo extends CommunityMessage {
	/**
	 * 是否是好友
	 */
	private Integer isFriend;

	/**
	 * 荣誉等级
	 */
	private Integer honorLevel;
	/**
	 * 荣誉名称
	 */
	private String honorLevelName;

	/** 是否显示置顶 **/
	private boolean showTop;
	/** 是否显示官方 **/
	private boolean showOfficial;

	private String source;
	private String circleIds;
	private String communityName;
	private String userNick;

	private String userLogo;

	private Integer replyCount;

	private String typeName;

	/** 是否被当前登录人点过赞;1-是,2-否 **/
	private java.lang.Integer isPraised;

	/** 是否被当前登录人关注;1-是,2-否 **/
	private java.lang.Integer isConcern;

	/** 是否显示点赞人列表 **/
	private java.lang.Boolean isShowPraiseList;

	/** 点赞人列表 **/
	private java.lang.String praiseUserList;

	/** 点赞人列表--UserBase对象列表 **/
	private List<UserBase> userList4Praise;

	/** 版主名称 **/
	private java.lang.String creatorName;

	/** 版主头象 **/
	private java.lang.String creatorImg;

	//用户发帖数
	private Integer talentCount;
    //用户评论数
	private Integer totalCommentCount;
	//用户发帖被点赞数
	private Integer totalPraiseCount;

	public String getCircleIds() {
		return circleIds;
	}

	public String getCommunityName() {
		return communityName;
	}

	public java.lang.String getCreatorImg() {
		return creatorImg;
	}

	public java.lang.String getCreatorName() {
		return creatorName;
	}

	/**
	 * 版主头像全URL example: http://192.168.1.xxx:8080/circle/1.png
	 * 
	 * @return
	 */
	public java.lang.String getFullCreatorImg() {
		if (StringUtil.isBlank(this.getCreatorImg())) {
			return "";
		} else if (this.getCreatorImg().indexOf("source://") > -1) {
			return this.getCreatorImg();
		} else {
			return super.getImgHandleDomain() + "" + this.getCreatorImg() + "" + UserConst.IMG_POSTFIX;
		}
	}

	public Integer getHonorLevel() {
		return honorLevel;
	}

	public String getHonorLevelName() {
		return honorLevelName;
	}

	public java.lang.Integer getIsConcern() {
		return isConcern;
	}

	public boolean getIsFriend() {
		if(null!=isFriend){
			return isFriend == 1 ? true : false;
		}
		return false;
	}

	public java.lang.Integer getIsPraised() {
		return isPraised;
	}

	/** 是否显示图片 **/
	public boolean getIsShowImg() {
		if (StringUtils.isNotBlank(this.getImg())) {
			return true;
		} else {
			return false;
		}
	}

	public java.lang.Boolean getIsShowPraiseList() {
		return isShowPraiseList;
	}

	public String getPathImgs() {
		if (StringUtil.isBlank(this.getImg())) {
			return "";
		}
		String filePath = ";" + this.getFileDomain();
		String pathImgs = this.getImg().replaceAll(";", filePath);
		return this.getFileDomain() + pathImgs;
	}

	public java.lang.String getPraiseUserList() {
		return praiseUserList;
	}

	public Integer getReplyCount() {
		return replyCount;
	}

	public String getSource() {
		return source;
	}

	public String getStrNewAt() {
		return TimeUtil.getStringTimeByFormat(getNewAt(), "yyyy-MM-dd HH:mm");
	}

	public String getStrUpdAt() {
		return TimeUtil.getStringTimeByFormat(getUpdAt(), "yyyy-MM-dd HH:mm");
	}

	public String getTypeName() {
		return typeName;
	}

	public List<UserBase> getUserList4Praise() {
		return userList4Praise;
	}

	public String getUserLogo() {
		return userLogo;
	}

	public String getUserNick() {
		return userNick;
	}

	public boolean isShowOfficial() {
		return showOfficial;
	}

	public boolean isShowTop() {
		return showTop;
	}

	public void setCircleIds(String circleIds) {
		this.circleIds = circleIds;
	}

	public void setCommunityName(String communityName) {
		this.communityName = communityName;
	}

	public void setCreatorImg(java.lang.String creatorImg) {
		this.creatorImg = creatorImg;
	}

	public void setCreatorName(java.lang.String creatorName) {
		this.creatorName = creatorName;
	}

	public void setHonorLevel(Integer honorLevel) {
		this.honorLevel = honorLevel;
	}

	public void setHonorLevelName(String honorLevelName) {
		this.honorLevelName = honorLevelName;
	}

	public void setIsConcern(java.lang.Integer isConcern) {
		this.isConcern = isConcern;
	}

	public void setIsFriend(Integer isFriend) {
		this.isFriend = isFriend;
	}

	public void setIsPraised(java.lang.Integer isPraised) {
		this.isPraised = isPraised;
	}

	public void setIsShowPraiseList(java.lang.Boolean isShowPraiseList) {
		this.isShowPraiseList = isShowPraiseList;
	}

	public void setPraiseUserList(java.lang.String praiseUserList) {
		this.praiseUserList = praiseUserList;
	}

	public void setReplyCount(Integer replyCount) {
		this.replyCount = replyCount;
	}

	public void setShowOfficial(boolean showOfficial) {
		this.showOfficial = showOfficial;
	}

	public void setShowTop(boolean showTop) {
		this.showTop = showTop;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public void setUserList4Praise(List<UserBase> userList4Praise) {
		this.userList4Praise = userList4Praise;
	}

	public void setUserLogo(String userLogo) {
		this.userLogo = userLogo;
	}

	public void setUserNick(String userNick) {
		this.userNick = userNick;
	}

	public Integer getTalentCount() {
		return talentCount;
	}

	public void setTalentCount(Integer talentCount) {
		this.talentCount = talentCount;
	}

	public Integer getTotalCommentCount() {
		return totalCommentCount;
	}

	public void setTotalCommentCount(Integer totalCommentCount) {
		this.totalCommentCount = totalCommentCount;
	}

	public Integer getTotalPraiseCount() {
		return totalPraiseCount;
	}

	public void setTotalPraiseCount(Integer totalPraiseCount) {
		this.totalPraiseCount = totalPraiseCount;
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}
}
